// 导入axios
import request from '@/utils/request'
// 获取角色列表
export function getRoleListApi() {
  return request({
    url: 'roles',
    method: 'get'
  })
}

// 删除角色对应的某个权限
export function delRightsByIdApi(roleId, rightsId) {
  return request({
    url: `roles/${roleId}/rights/${rightsId}`,
    method: 'DELETE'
  })
}

// 给角色分配（修改）权限
export function setRoleRightsApi(roleId, rights) {
  return request({
    url: `roles/${roleId}/rights`,
    method: 'post',
    data: {
      rids: rights
    }
  })
}
